package com.eusoft.demo.config;

import com.eusoft.demo.interceptor.JwtTokenInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author eusoft
 * @since 2021-10-12
 */
@Component
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JwtTokenInterceptor()).
                excludePathPatterns("/user/login")
                .addPathPatterns("/**");
    }
}

